﻿#include "FITKAcousticsHDF5Object.h"
#include "FITKAcousticsHDF5AttributeObject.hpp"
#include "FITKAcousticsHDF5DataSet.hpp"

Acoustics::FITKAcousticsHDF5Object::FITKAcousticsHDF5Object()
{
    //构造函数
}

Acoustics::FITKAcousticsHDF5Object::~FITKAcousticsHDF5Object()
{
    //析构函数
    if (_attrManager) delete _attrManager;
    if (_datasetManager) delete _datasetManager;
    if (_childManager) delete _childManager;
}

Acoustics::FITKAcousticsHDF5AttributeManager* Acoustics::FITKAcousticsHDF5Object::getFITKAcousticsHDF5AttributeManager()
{
    //返回参数集管理器对象
    if(nullptr == _attrManager)
    {
        _attrManager = new FITKAcousticsHDF5AttributeManager();
    }
    return _attrManager;

}

Acoustics::FITKAcousticsHDF5DataSetManager* Acoustics::FITKAcousticsHDF5Object::getFITKAcousticsHDF5DataSetManager()
{
    //返回数据集管理器对象
    if (nullptr == _datasetManager)
    {
        _datasetManager = new FITKAcousticsHDF5DataSetManager();
    }
    return _datasetManager;
}

Acoustics::FITKAcousticsHDF5ObjectManager* Acoustics::FITKAcousticsHDF5Object::getFITKAcousticsHDF5ObjectChildManager()
{
    //返回子集管理器对象
    if (nullptr == _childManager)
    {
        _childManager = new FITKAcousticsHDF5ObjectManager();
    }
    return _childManager;
}

void Acoustics::FITKAcousticsHDF5Object::clearData()
{
    //清空数据
    if (nullptr != _attrManager)  _attrManager->clear();
    if (nullptr != _datasetManager)  _datasetManager->clear();
    if (nullptr != _childManager)  _childManager->clear();

}
